﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ReviewCurveApp.Classes
{
    public class StandardCurve:IMemoryCurve
    {
        public List<DateTime> GetRecitingSequnce(DateTime startTime)
        {
            List<DateTime> times = new List<DateTime>();
            times.Add(startTime);
            times.Add(startTime.AddMinutes(30));
            times.Add(startTime.AddDays(1));
            times.Add(startTime.AddDays(2));
            times.Add(startTime.AddDays(4));
            times.Add(startTime.AddDays(7));
            times.Add(startTime.AddDays(15));
            times.Add(startTime.AddDays(30));
            return times;
        }



        public DateTime? GetNextPlanDate(int oldSequence, DateTime? LastTime)
        {
            switch (oldSequence)
            {
                case 1:
                   return LastTime.Value.AddMinutes(30);
                case 2:
                   return LastTime.Value.AddDays(1);
                case 3:
                   return LastTime.Value.AddDays(1);
                case 4:
                   return LastTime.Value.AddDays(2);
                case 5:
                   return LastTime.Value.AddDays(3);
                case 6:
                   return LastTime.Value.AddDays(8);
                case 7:
                   return LastTime.Value.AddDays(15);
                default:
                   return LastTime.Value.AddDays(30);
            }
        }
    }
}
